package com.qf.agro.web.controller.crop;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.agro.common.sys.ResultInfo;
import com.qf.agro.pojo.crop.SaAgroRelay;
import com.qf.agro.service.crop.SaAgroRelayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 六六六
 * @create: 2023-07-06 11:47
 **/
@RestController
@RequestMapping("/relay")
public class SaAgroRelayController {

    @Autowired
    private SaAgroRelayService service;

    @GetMapping("/page")
    public ResultInfo findPage(@RequestParam(value = "page",defaultValue = "5")int pageNum,
                               @RequestParam(defaultValue = "1")int pageSize,
                                String name){
        Page<SaAgroRelay> page = service.findPage(pageNum, pageSize,name);
        return  ResultInfo.success(page);
    }
}
